//
//  DENForumModel.m
//  Icar
//
//  Created by apple on 15/10/16.
//  Copyright © 2015年 小龙侠. All rights reserved.
//

#import "DENForumModel.h"

@implementation DENForumModel

#pragma mark - 编码存储
- (void)encodeWithCoder:(NSCoder *)aCoder{
    
    [aCoder encodeObject:self.datatime forKey:@"datatime"];
    [aCoder encodeInteger:self.replycount forKey:@"replycount"];
    [aCoder encodeObject:self.forumlink forKey:@"forumlink"];
    [aCoder encodeObject:self.forum forKey:@"forum"];
    [aCoder encodeObject:self.desc forKey:@"desc"];
    [aCoder encodeInteger:self.topicId forKey:@"topicId"];
    [aCoder encodeObject:self.topic forKey:@"topic"];
    [aCoder encodeInteger:self.topicimgcount forKey:@"topicimgcount"];
    [aCoder encodeObject:self.userface forKey:@"userface"];
    [aCoder encodeObject:self.nickname forKey:@"nickname"];
    [aCoder encodeInteger:self.view forKey:@"view"];
    [aCoder encodeInteger:self.forumId forKey:@"forumId"];
    [aCoder encodeFloat:self.topicHeight forKey:@"topicHeight"];
    [aCoder encodeObject:self.topicimg forKey:@"topicimg"];
    [aCoder encodeObject:self.topiclink forKey:@"topiclink"];
}

#pragma mark - 解码读取

- (id)initWithCoder:(NSCoder *)aDecoder{
    
    self = [super init];
    if (self) {
        self.datatime = [aDecoder decodeObjectForKey:@"datatime"];
        self.replycount = [aDecoder decodeIntegerForKey:@"replycount"];
        self.forumlink = [aDecoder decodeObjectForKey:@"forumlink"];
        self.forum = [aDecoder decodeObjectForKey:@"forum"];
        self.desc = [aDecoder decodeObjectForKey:@"desc"];
        self.topicId = [aDecoder decodeIntegerForKey:@"topicId"];
        self.topic = [aDecoder decodeObjectForKey:@"topic"];
        self.topicimgcount = [aDecoder decodeIntegerForKey:@"topicimgcount"];
        self.userface = [aDecoder decodeObjectForKey:@"userface"];
        self.nickname = [aDecoder decodeObjectForKey:@"nickname"];
        self.view = [aDecoder decodeIntegerForKey:@"view"];
        self.forumId = [aDecoder decodeIntegerForKey:@"forumId"];
        self.topicHeight = [aDecoder decodeFloatForKey:@"topicHeight"];
        self.topicimg = [aDecoder decodeObjectForKey:@"topicimg"];
        self.topiclink = [aDecoder decodeObjectForKey:@"topiclink"];
    }
    return self;
}

@end
